package first.endtoend

/**
 * this class copies the content of a category_product and affect it to each family of this category
 * This lead to control SEPARATELY families' portfolios
 *
 */
class PortfolioDetail
{

    float reduction
    float quantity
    Date dateCreated
    Date lastUpdated
    static belongsTo = [portfolio: Portfolio, aid: Aid, product: Product]
    static constraints = {

        quantity min: 0.00f
        reduction min: 0.01f
        portfolio(nullable: true)
        aid(nullable: true)
        product(nullable: true)
    }

    @Override
    public String toString()
    {
        portfolio.id + " " + aid.id + " " + product.name
    }

}
